﻿<cfsilent>
	<cfscript>
		
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		
		event.setArg("pageTitle", "教学运行管理 - 考试安排 - 期中考试安排");

		mathAdvice = getProperty("serviceFactory").getBean("senateMathAdvice");

		termId = event.getArg("TermID");

		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");
		
		currentTab = event.getArg("TabID", "labArrangePlan");

		passArgs = structNew();
		
		targetArgs = structNew();
		passDelArgs = structNew();
		structInsert(targetArgs, "TID", termId);
			
		sql = "SELECT 
				a.task_exid, 
				b.course_name, 
				c.campus_name, 
				a.wid, 
				a.examer_sum, 
				d.institute_short,
				a.cid  
				FROM t_examtask a  
					 INNER JOIN t_course b ON b.cid = a.cid 
					 INNER JOIN t_campus c ON c.campus_id = a.campus_id 
					 INNER JOIN t_institute d ON d.institute_id = b.institute_id 
				WHERE 
					a.term_id = :termId 
					AND 
					a.task_prog = '0' 
					AND 
					a.exam_type = 'M'
				ORDER BY d.institute_short, b.course_name, a.wid";
		
		queryObj = new Query( datasource=application.dnsSlave ) ;
   		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_task= queryObj.execute( sql=sql ).getResult();
				
		sql = "SELECT 
				a.task_exid, 
				b.course_name, 
				c.campus_name, 
				a.wid, 
				a.examer_sum, 
				d.institute_short,
				a.wdidx,
				a.cellidx
				FROM t_examtask a  
					 INNER JOIN t_course b ON b.cid = a.cid 
					 INNER JOIN t_campus c ON c.campus_id = a.campus_id 
					 INNER JOIN t_institute d ON d.institute_id = b.institute_id 
				WHERE 
					a.term_id = :termId 
					AND 
					a.task_prog = '1' 
					AND 
					a.exam_type = 'M'
				ORDER BY d.institute_short, b.course_name, a.wid";
		
		queryObj = new Query( datasource=application.dnsSlave ) ;
   		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_taskTimeOnly= queryObj.execute( sql=sql ).getResult();
					
		sql = "SELECT 
				a.task_exid, 
				b.course_name, 
				c.campus_name, 
				a.wid, 
				a.examer_sum, 
				d.institute_short,
				a.wdidx,
				a.cellidx,
				( SELECT count(*) 
				  FROM t_clsroom_timetable e 
					   INNER JOIN t_clsroom_forexam f ON f.crtime_id = e.crtime_id
				  WHERE a.task_exid = f.task_exid 
				) table_counnt 
				FROM t_examtask a  
					 INNER JOIN t_course b ON b.cid = a.cid 
					 INNER JOIN t_campus c ON c.campus_id = a.campus_id 
					 INNER JOIN t_institute d ON d.institute_id = b.institute_id 
				WHERE 
					a.term_id = :termId 
					AND 
					a.task_prog = '2' 
					AND 
					a.exam_type = 'M'
				ORDER BY d.institute_short, b.course_name";
		
		queryObj = new Query( datasource=application.dnsSlave ) ;
   		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_taskPlaceDone= queryObj.execute( sql=sql ).getResult();
			
		sql = "SELECT 
				a.task_exid, 
				b.course_name, 
				c.campus_name, 
				a.wid, 
				a.examer_sum, 
				d.institute_short,
				a.wdidx,
				a.cellidx,
				( SELECT count(*) 
				  FROM t_clsroom_timetable e 
					   INNER JOIN t_clsroom_forexam f ON f.crtime_id = e.crtime_id
				  WHERE a.task_exid = f.task_exid 
				) table_counnt 
				FROM t_examtask a  
					 INNER JOIN t_course b ON b.cid = a.cid 
					 INNER JOIN t_campus c ON c.campus_id = a.campus_id 
					 INNER JOIN t_institute d ON d.institute_id = b.institute_id 
				WHERE 
					a.term_id = :termId 
					AND 
					a.task_prog = '3' 
					AND 
					a.exam_type = 'M'
				ORDER BY d.institute_short, b.course_name";
		
		queryObj = new Query( datasource=application.dnsSlave ) ;
   		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_taskPublish= queryObj.execute( sql=sql ).getResult();
	
		keyword = event.getArg('Keywords');
		
		rs_planCourses = queryNew("cid");

		if ( len(keyword) ) {
			currentTab = event.getArg("TabID", "labSearch");
		
			sql = "SELECT 
					a.cid, 
					a.course_name, 
					a.course_code, 
					e.institute_short, 
					a.course_credit, 
					a.period, a.period_theory, a.period_practice, a.period_computer, 
					a.mark_mode 
					FROM t_course a 
						INNER JOIN t_institute e ON e.institute_id = a.institute_id 
					WHERE
						(
							a.course_name LIKE :keyword 
							OR 
							a.course_code LIKE :keyword
						)
						AND 
						(
							EXISTS (
								SELECT 1
								FROM t_task b 
								WHERE 
									a.cid = b.cid 
									AND 
									b.term_id = :termId 
									AND 
									SUBSTR(b.task_prop, 7, 1) = '0' 
							)
							OR 
							EXISTS (
								SELECT 1 
								FROM t_common_task c 
								WHERE 
									a.cid = c.cid
									AND 
									c.term_id = :termId 
									AND 
									SUBSTR(c.task_prop, 7, 1) = '0' 
							)
							OR 
							EXISTS (
								SELECT 1 
								FROM  t_reopen_task d 
								WHERE 
									a.cid = d.cid
									AND 
									d.term_id = :termId 
									AND 
									SUBSTR(d.task_prop, 7, 1) = '0' 
							)
						)
					ORDER BY 
						e.institute_short, 
						a.course_name";
		
			queryObj = new Query( datasource=application.dnsSlave,maxRows = 30 ) ;
			queryObj.addParam( name="keyword", value=keyword&'%', cfsqltype="cf_sql_varchar" );
			queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
			
			rs_planCourses= queryObj.execute( sql=sql ).getResult();
		}
		
		sql = "SELECT 
				b.course_name, b.course_credit,  
				count(*) plan_count, 
				a.cid
				FROM t_exammidplan a  
					INNER JOIN t_course b ON b.cid = a.cid 
				WHERE 
					a.term_id = :termId 
					AND
					a.is_arrange = '0' 
				GROUP BY  b.course_name, b.course_credit, a.cid  
				ORDER BY  b.course_name ";
				
		queryObj = new Query( datasource=application.dnsSlave ) ;
   		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_courseToDo= queryObj.execute( sql=sql ).getResult();
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('DEFAULT_EVENT')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">考试安排</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 exam"></i>期中考试安排
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix">
			
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labArrangePlan">class="active"</cfif> id="labArrangePlan" tabTarget="ArrangePlan">考试计划</span>
						<span <cfif currentTab eq "labSearch">class="active"</cfif> id="labSearch" tabTarget="Search">新增考试课程</span>
						<cfif rs_task.recordCount>
							<span <cfif currentTab eq "labArrange">class="active"</cfif> id="labArrange" tabTarget="Arrange">安排时间和地点</span>
						</cfif>
						<cfif rs_taskTimeOnly.recordCount>
							<span <cfif currentTab eq "labTimeOnly">class="active"</cfif> id="labTimeOnly" tabTarget="TimeOnly">仅安排时间</span>
						</cfif>
						<cfif rs_taskPlaceDone.recordCount>
							<span <cfif currentTab eq "labDoneCourse">class="active"</cfif> id="labDoneCourse" tabTarget="DoneCourse">已安排</span>
						</cfif>
						<cfif rs_taskPublish.recordCount>
							<span <cfif currentTab eq "labPublished">class="active"</cfif> id="labPublished" tabTarget="Published">已发布</span>
						</cfif>
					</div>
				</div>
				
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				<div id="ArrangePlan" class="tabContent">
				<cfif rs_courseToDo.recordCount>
					<div class="noticeBlock">
						<div class="operation">
						</div>
						<h3>等待安排考试周次</h3>
						<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 有<em><cfoutput>#rs_courseToDo.recordCount#</cfoutput></em>门课程等待安排考试时间</p>
						<hr/>
					</div>
						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="18"></td>
									<td>课程</td>
									<td width="50">教学班</td>
									<td width="30">学分</td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
							<!---	<cfloop array="#courseToDoArray#" index="course">--->
                                <cfloop query="rs_courseToDo" >
									<cfset row++ />
									<cfset structInsert(passArgs, "CID", rs_courseToDo.cid, true) />
									<cfset structInsert(passArgs, "TID", termId, true) />
									<cfset structInsert(targetArgs, "CourseID", rs_courseToDo.cid, true) />
									<cfset structInsert(targetArgs, "TermID", termId, true) />
									<tr class="editRows">
										<td><a title="取消该门课程考试计划" href="<cfoutput>#buildURL('examMidCourseRemoveDo', targetArgs)#</cfoutput>" class="stat remove"></a></td>
										<td><cfoutput>#rs_courseToDo.course_name#</cfoutput></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_courseToDo.plan_count#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#numberFormat(rs_courseToDo.course_credit, "_.__")#</cfoutput></span></td>
										<td><a title="安排课程考试周次与分组" href="<cfoutput>#buildURL('examMidArrangeByCourse', passArgs)#</cfoutput>"  class="stat edit"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
				<cfelse>
					<div class="systemNotice">
						<p>没有期中考试计划数据</p>
					</div>
				</cfif>
				</div>
				<div id="Search" class="tabContent">
				
					<form id="formSearch" onSubmit="javascript:return processVerfiyForm('formSearch');" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('examMidArrange', targetArgs)#</cfoutput>">
						<div class="label">
							<b>课程名称</b>
							<input name="Keywords" id="Keywords" type="text" class="typeText" verification="required" maxlength="128" value="<cfoutput>#event.getArg('Keywords')#</cfoutput>" />
						</div>
						<hr/>
						<div class="lable">
							<input class="button1" type="submit" value="搜索课程" />
						</div>
					</form>

					<cfif rs_planCourses.recordCount >

						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="18"></td>
									<td>任课单位</td>
									<td width="80">课程号</td>
									<td>课程</td>
									<td width="30" align="center">学分</td>
									<td width="50" align="center">计分</td>
									<td width="36" align="center">总学时</td>
									<td width="24" align="center">理论</td>
									<td width="24" align="center">实践</td>
									<td width="24" align="center">上机</td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
								<!---<cfloop array="#planCourses#" index="course">--->
                                <cfloop query="rs_planCourses" >
									<cfset row ++ />
									<cfset structInsert(targetArgs, "CID", rs_planCourses.cid, true) />
									<tr class="editRows">
										<td><span class="index"><cfoutput>#row#</cfoutput></span></td>
										<td><cfoutput>#rs_planCourses.institute_short#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_planCourses.course_code#</cfoutput></span></td>
										<td><cfoutput>#rs_planCourses.course_name#</cfoutput></td>
										<td align="center"><span class="numeric"><cfoutput>#numberFormat( rs_planCourses.course_credit, "_.__" )#</cfoutput></span></td>
										<td align="center"><cfoutput>#dictAdvice.getMarkModeName(rs_planCourses.mark_mode)#</cfoutput></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_planCourses.period#</cfoutput></span></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_planCourses.period_theory#</cfoutput></span></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_planCourses.period_practice#</cfoutput></span></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_planCourses.period_computer#</cfoutput></span></td>
										<td><a title="加入考试计划" href="<cfoutput>#buildURL('examMidArrangeByCourse', targetArgs)#</cfoutput>" class="stat select"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
							<cfelse>
							  <cfif len(keyword)>
								<div class="systemNotice">
									<p>没有找到该课程或该课程没有安排教学任务</p>
								</div>
							 </cfif>
					</cfif>
				
				</div>
				<cfif rs_task.recordCount>
			
					<div id="Arrange" class="tabContent">
						<div class="noticeBlock">
							<h3>尚未安排时间、地点的期中考试任务</h3>
							<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 尚有<cfoutput>#rs_task.recordCount#</cfoutput>场次考试需要安排时间和考试场地.</p>
						</div>
					
						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="25"></td>
									<td width="50">任课单位</td>
									<td>课程</td>
									<td width="50">考试校区</td>
									<td width="30">周次</td>
									<td width="40">人数</td>
									<td width="25"></td>
									<td width="25"></td>
									<td width="25"></td>
								</tr>
							</thead>
							<tbody>
								<!---<cfloop array="#taskArray#" index="task">--->
                                <Cfloop query="rs_task" >
									<cfset row ++ />
									<cfset structInsert(passArgs, "EXID", rs_task.task_exid, true) />
									<cfset structInsert(passArgs, "ExamType", "M", true) />
									<cfset structInsert(passDelArgs, "TaskExamID", rs_task.task_exid, true) />
									<cfset structInsert(passDelArgs, "CourseID", rs_task.cid, true) />
									<cfset structInsert(passDelArgs, "TermID", termId, true) />
									<tr class="editRows">
										<td class="index"><cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_task.institute_short#</cfoutput></td>
										<td><cfoutput>#rs_task.course_name#</cfoutput></td>
										<td><cfoutput>#rs_task.campus_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_task.wid#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_task.examer_sum#</cfoutput></span></td>
										<td><a title="自动安排时间和考试场地" class="stat arrange" href="<cfoutput>#buildURL('examMidTaskAuto', passArgs)#</cfoutput>"></a></td>
										<td><a title="仅指定考试时间" class="stat settime" href="<cfoutput>#buildURL('examMidTaskSetTime', passArgs)#</cfoutput>"></a></td>
										<td><a title="删除考试任务" href="<cfoutput>#buildURL('examMidTaskByDepartmentRemoveDo', passDelArgs)#</cfoutput>" class="stat delete"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
				
					</div>
				
				</cfif>

				<cfif rs_taskPlaceDone.recordCount>
				
					<div id="DoneCourse" class="tabContent">
					
						<div class="noticeBlock">
							<h3>安排时间地点的考试任务</h3>
							<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 有<cfoutput>#rs_taskPlaceDone.recordCount#</cfoutput>场次考试已安排.</p>
						</div>
						
						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="25"></td>
									<td width="50">任课单位</td>
									<td>课程</td>
									<td width="50">考试校区</td>
									<td width="30">周次</td>
									<td width="80">时间</td>
									<td width="40">人数</td>
									<td width="40">考场</td>
									<td width="25"></td>
									<td width="25"></td>
									<td width="25"></td>
								</tr>
							</thead>
							<tbody>
                                <cfloop query="rs_taskPlaceDone"  >
									<cfset row ++ />
									<cfset structInsert(passArgs, "EXID", rs_taskPlaceDone.task_exid, true) />
									<cfset structInsert(passArgs, "ExamType", "M", true) />
									<tr class="editRows">
										<td class="index"><cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_taskPlaceDone.institute_short#</cfoutput></td>
										<td><cfoutput>#rs_taskPlaceDone.course_name#</cfoutput></td>
										<td><cfoutput>#rs_taskPlaceDone.campus_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_taskPlaceDone.wid#</cfoutput></span></td>
										<td><cfoutput>#mathAdvice.convertWeekDayToChinese(rs_taskPlaceDone.wdidx)#</cfoutput><cfoutput>#mathAdvice.convertExamIdxToChinese(rs_taskPlaceDone.cellidx)#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_taskPlaceDone.examer_sum#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_taskPlaceDone.table_counnt#</cfoutput></span></td>
										<td><a title="更改考试时间" class="stat settime" href="<cfoutput>#buildURL('examMidTaskSetTime', passArgs)#</cfoutput>"></a></td>
										<td><a title="清除考试时间、地点安排" class="stat clear" href="javascript:clearExamTask('<cfoutput>#rs_taskPlaceDone.task_exid#</cfoutput>');"></a></td>
										<td><a title="向学生发布考试安排" class="stat publish" href="javascript:publishExamTask('<cfoutput>#rs_taskPlaceDone.task_exid#</cfoutput>');"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						
					</div>
					
				</cfif>

				<cfif rs_taskTimeOnly.recordCount>
			
					<div id="TimeOnly" class="tabContent">
					
						<div class="noticeBlock">
							<h3>已指定时间的考试任务</h3>
							<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 尚有<cfoutput>#rs_taskTimeOnly.recordCount#</cfoutput>场次考试未安排场地和座次.</p>
						</div>
					
						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="25"></td>
									<td width="50">任课单位</td>
									<td>课程</td>
									<td width="50">考试校区</td>
									<td width="30">周次</td>
									<td width="80">时间</td>
									<td width="40">人数</td>
									<td width="25"></td>
									<td width="25"></td>
								</tr>
							</thead>
							<tbody>
                                <cfloop query="rs_taskTimeOnly"  >
									<cfset row ++ />
									<cfset structInsert(passArgs, "EXID", rs_taskTimeOnly.task_exid, true) />
									<cfset structInsert(passArgs, "ExamType", "M", true) />
									<tr class="editRows">
										<td class="index"><cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_taskTimeOnly.institute_short#</cfoutput></td>
										<td><cfoutput>#rs_taskTimeOnly.course_name#</cfoutput></td>
										<td><cfoutput>#rs_taskTimeOnly.campus_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_taskTimeOnly.wid#</cfoutput></span></td>
										<td><cfoutput>#mathAdvice.convertWeekDayToChinese(rs_taskTimeOnly.wdidx)#</cfoutput><cfoutput>#mathAdvice.convertExamIdxToChinese(rs_taskTimeOnly.cellidx)#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_taskTimeOnly.examer_sum#</cfoutput></span></td>
										<td><a title="更改考试时间" class="stat settime" href="<cfoutput>#buildURL('examMidTaskSetTime', passArgs)#</cfoutput>"></a></td>
										<td><a title="自动安排考试场地" class="stat setplace" href="<cfoutput>#buildURL('examMidTaskSetClassroom', passArgs)#</cfoutput>"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						
					</div>
					
				</cfif>
	
				<cfif rs_taskPublish.recordCount>
				
					<div id="Published" class="tabContent">
					
						<div class="noticeBlock">
							<div class="operation">
								<cfset structInsert(targetArgs, "ExamType", "M", true) />
								<a class="uiButton" target="_blank" href="<cfoutput>#buildURL('allExamPrintSitMap', targetArgs)#</cfoutput>"><i class="mrs img btnPrint"></i><span class="uiButtonText">批量打印座次表</span></a>
								<a class="uiButton" target="_blank" href="<cfoutput>#buildURL('allExamPrintSignature', targetArgs)#</cfoutput>"><i class="mrs img btnPrint"></i><span class="uiButtonText">批量打印签到表</span></a>
								<a class="uiButton uiButtonSpecial" href="<cfoutput>#buildURL('examDownloadExcel', targetArgs)#</cfoutput>"><i class="mrs img btnDownload"></i><span class="uiButtonText">下载课程考试时间、地点安排</span></a>
							</div>
							<h3>已发布考试任务</h3>
							<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 有<cfoutput>#rs_taskPublish.recordCount#</cfoutput>场次考试已完成安排, 并向学院发布.</p>
						</div>
						
						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="25"></td>
									<td width="50">任课单位</td>
									<td>课程</td>
									<td width="50">考试校区</td>
									<td width="30">周次</td>
									<td width="80">时间</td>
									<td width="40">人数</td>
									<td width="40">考场</td>
									<td width="25"></td>
									<td width="25"></td>
								</tr>
							</thead>
							<tbody>
                                <cfloop query="rs_taskPublish" >
									<cfset row ++ />
									<cfset structInsert(passArgs, "EXID", rs_taskPublish.task_exid, true) />
									<cfset structInsert(passArgs, "ExamType", "M", true) />
									<tr class="editRows">
										<td class="index"><cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_taskPublish.institute_short#</cfoutput></td>
										<td><cfoutput>#rs_taskPublish.course_name#</cfoutput></td>
										<td><cfoutput>#rs_taskPublish.campus_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_taskPublish.wid#</cfoutput></span></td>
										<td><cfoutput>#mathAdvice.convertWeekDayToChinese(rs_taskPublish.wdidx)#</cfoutput><cfoutput>#mathAdvice.convertExamIdxToChinese(rs_taskPublish.cellidx)#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_taskPublish.examer_sum#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_taskPublish.table_counnt#</cfoutput></span></td>
										<td><a title="清除考试时间、地点安排" class="stat clear" href="javascript:clearExamTask('<cfoutput>#rs_taskPublish.task_exid#</cfoutput>');"></a></td>
										<td><a title="查看课程考试详细安排" class="stat details" href="<cfoutput>#buildURL('examTaskPrint', passArgs)#</cfoutput>"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						
					</div>
				</cfif>
						<script language="javascript" type="text/javascript">
							//<![CDATA[
							<!--
							function publishExamTask(examId) {
								$.post(
										"<cfoutput>#buildURL('apiExamTaskPublish')#</cfoutput>", 
										{
											'exid' : examId,
											'seed': (new Date()).getTime()
										}, 
										function(data) {
					
											result = $.parseJSON(data);
										
											if (result.success) {
												/* 刷新排考数据 */
												window.location = '<cfoutput>#buildURL('examMidArrange')#</cfoutput>&TabID=labPublished';
											}
											else {
												alert(result.reason);
											}
					
										});
							}
							
							function clearExamTask(examId) {

								$.post(
										"<cfoutput>#buildURL('apiExamTaskClear')#</cfoutput>", 
										{
											'exid' : examId,
											'seed': (new Date()).getTime()
										}, 
										function(data) {

											result = $.parseJSON(data);
										
											if (result.success) {
												/* 刷新排考数据 */
												window.location = '<cfoutput>#buildURL('examMidArrange')#</cfoutput>&TabID=labArrange';
											}
											else {
												alert(result.reason);
											}
					
										});
								
							}
							
							// -->
							//]]>
						</script>
			</div>
		</li>
	</ul>
</div>